package regulatoryInteractionsStats.yeast.bioJava;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



import java.util.Arrays;

/**
 *
 * @author jamie
 */
public class MyAlignment {

    private String accession1;
    private String accession2;
    private int length1;
    private int length2;
    private int alignmentLength;
    private int identity;
    private double score;
    private String key;

    public int getAlignmentLength() {
        return alignmentLength;
    }

    public void setAlignmentLength(int alignmentLength) {
        this.alignmentLength = alignmentLength;
    }

    public int getIdentity() {
        return identity;
    }

    public void setIdentity(int identity) {
        this.identity = identity;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    public String getAccession1() {
        return accession1;
    }

    public void setAccession1(String accession1) {
        this.accession1 = accession1;
    }

    public String getAccession2() {
        return accession2;
    }

    public void setAccession2(String accession2) {
        this.accession2 = accession2;
    }

    public int getLength1() {
        return length1;
    }

    public void setLength1(int length1) {
        this.length1 = length1;
    }

    public int getLength2() {
        return length2;
    }

    public void setLength2(int length2) {
        this.length2 = length2;
    }

    public void setKey(){
        this.key = getKey(accession1, accession2);
    }

    public void setKey(String key){
        this.key = key;
    }

    public String getKey(){
        return this.key;
    }

    public static String getKey(String accession1, String accession2){
        String accessions[] = {accession1, accession2};
        Arrays.sort(accessions);
        return accessions[0]+"__"+accessions[1];

    }


    public MyAlignment myclone(){
        
            MyAlignment clone = new MyAlignment();
            clone.setAccession1(accession1);
            clone.setAccession2(accession2);
            clone.setAlignmentLength(alignmentLength);
            clone.setIdentity(identity);
            clone.setLength1(length1);
            clone.setLength2(length2);
            clone.setScore(score);
            clone.setKey();
            return clone;



    }
    

    

}
